package string;

import java.util.Arrays;

public class StringBuilderDemo {
    public static void main(String[] args) {

        StringBuilder sb = new StringBuilder("红红火火恍恍惚惚");
        System.out.println(sb);
        sb.delete(0, 4);
        System.out.println(sb);
        sb.insert(0, "红红火火");
        System.out.println(sb);
/*        String s = "好好学习Java";
        StringBuilder sb = new StringBuilder(s);
        sb.append(",为了改变世界");
        sb.replace(sb.indexOf(",") + 1, sb.length(), "为了");
        System.out.println(sb);*/
     /*   String str = "abc";
        StringBuilder sb1 = new StringBuilder(str);
        StringBuilder sb = new StringBuilder();
        sb.append("hahah");
        sb.append("huhuhu");
        String str2 = sb.toString();
        System.out.println(str2);*/

    }
}
